package com.zjc.yohoshop.mvp.model;

import com.zjc.lib_core.http.MResponseManager;
import com.zjc.lib_core.mvp.model.BaseModel;
import com.zjc.yohoshop.bean.AddCarEntity;
import com.zjc.yohoshop.bean.BaseEntity;
import com.zjc.yohoshop.bean.CollectionEntity;
import com.zjc.yohoshop.bean.GoodsValuesEntity;
import com.zjc.yohoshop.bean.SelGoodsValuesEntity;
import com.zjc.yohoshop.bean.UncollectionEntity;
import com.zjc.yohoshop.mvp.contract.GoodsValuesFragmentContract;
import com.zjc.yohoshop.network.API;

import javax.inject.Inject;

import io.reactivex.Observable;

public class GoodsValuesFragmentModel extends BaseModel implements GoodsValuesFragmentContract.GoodsValuesFragmentIModel {

    @Inject
    public GoodsValuesFragmentModel() {}


    @Override
    public Observable<BaseEntity> values(String request) {
        Observable<GoodsValuesEntity> goodsValuesEntityObservable = MResponseManager.obtainRetrofit(API.class).goods_values_request(request);
        Observable<SelGoodsValuesEntity> selGoodsValuesEntityObservable = MResponseManager.obtainRetrofit(API.class).sel_goods_values_request(request);
        return Observable.merge(goodsValuesEntityObservable, selGoodsValuesEntityObservable);
    }

    @Override
    public Observable<AddCarEntity> AddCarValues(String request) {
        return MResponseManager.obtainRetrofit(API.class).add_car_request(request);
    }

    @Override
    public Observable<CollectionEntity> CollectionValues(String request) {
        return MResponseManager.obtainRetrofit(API.class).collection_request(request);
    }

    @Override
    public Observable<UncollectionEntity> UncollectionValues(String request) {
        return MResponseManager.obtainRetrofit(API.class).uncollection_request(request);
    }


    @Override
    public void destroy() {

    }

}
